/**
 * @file   openglenum.h
 * @Author Alexandre Chassany (alexandre.chassany@gmail.com)
 * @date   Mai 2011
 *
 * Poum-tchak is a free sound manipulation and synthesis, 
 * real-time and interactive music-clip rendering.
 *
 * Copyright (C) 2011  Chassany Alexandre and Gonzalez Antoine.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * he Free Software Foundation, either version 3 of the License, or
 * at your option) any later version.
 *
 * is program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#include <renderer/impl/opengl/openglenum.h>
#include <renderer/enum.h>
#include <GL/glew.h>

namespace Elixir
{
  unsigned long getOpenglBufferFlags(unsigned long flags)
  {
	return (flags & BUF_DYNAMIC ? GL_DYNAMIC_DRAW_ARB : GL_STATIC_DRAW_ARB);
  }

  unsigned long getOpenglLockFlags(unsigned long flags)
  {
	unsigned long lockFlags = GL_READ_WRITE_ARB;
    if (flags & LOCK_READONLY)  lockFlags = GL_READ_ONLY_ARB;
    if (flags & LOCK_WRITEONLY) lockFlags = GL_WRITE_ONLY_ARB;

    return lockFlags;
  }
}
